<template>
  <div class="Showcase1">
    <div class="shadow-box">
      <img class="shadow-left" :src="publicUrls + 'free/style3/Showcase1bg9.webp'" alt="" />
      <div
        class="shadow-center"
        :style="{
          backgroundImage: `url(${publicUrls + 'free/style3/Showcase1bg10.webp'})`,
        }"
      ></div>
      <img class="shadow-right" :src="publicUrls + 'free/style3/Showcase1bg11.webp'" alt="" />
    </div>

    <div class="Showcase1-top">
      <img
        class="Showcase1-top-left"
        :src="publicUrls + 'free/style3/Showcase1bg1.webp'"
        alt=""
      />
      <div
        class="Showcase1-top-center"
        :style="{
          backgroundImage: `url(${publicUrls + 'free/style3/Showcase1bg2.webp'})`,
        }"
      ></div>
      <img
        class="Showcase1-top-right"
        :src="publicUrls + 'free/style3/Showcase1bg3.webp'"
        alt=""
      /> 
    </div> 
    <div class="Showcase1-center">
      <div
        :style="{
          left: `${ShowcaseItemTransform(item.x ? item.x : getParentX(index), item.width, 1.306)}rem`,
          backgroundImage: `url(${publicUrls + 'free/style3/Showcase1NameBg.webp'})`,
        }"
        class="ex-item"
        v-for="(item, index) in props.list"
        :key="index" 
      >
        <p class="name-box">
          {{ item.name }}
        </p>
      </div>
      <img
        class="Showcase1-center-left"
        :src="publicUrls + 'free/style3/Showcase1bg4.webp'"
        alt=""
      />
      <div
        class="Showcase1-center-center"
        :style="{
          backgroundImage: `url(${publicUrls + 'free/style3/Showcase1bg5.webp'})`,
        }"
      ></div>
    </div>
    <div class="Showcase1-bottom">
      <img
        class="Showcase1-bottom-left"
        :src="publicUrls + 'free/style3/Showcase1bg6.webp'"
        alt=""
      />
      <div
        class="Showcase1-bottom-center"
        :style="{
          backgroundImage: `url(${publicUrls + 'free/style3/Showcase1bg7.webp'})`,
        }"
      ></div>
      <img
        class="Showcase1-bottom-right"
        :src="publicUrls + 'free/style3/Showcase1bg8.webp'"
        alt=""
      />
    </div>
    <!-- Showcase1Topleft -->
  </div>
</template>   

<script lang="ts">
export default defineComponent({
  name: 'style1',
});
</script>
  
<script setup lang="ts">
import { ShowcaseItemTransform } from '@/utils/setmaterialStyle';
import { publicUrls } from '@/utils/minxin';
import { defineComponent } from 'vue';
const props = defineProps({
  list: {
    type: Object,
  },
});
// 1.30
const getParentX = (indexs: number) => {
  let x = 0;
  for (let index = 0; index < indexs; index++) {
    // const element = array[index];
    x = x + props.list[index].width;
  }

  return x + 0.3;
};
</script>  

<style scoped lang="less">
.Showcase1 {
  position: relative;
  display: flex;  
  flex-direction: column;
  align-items: center; 
  width: 100%;
  height: 100%;
  min-height: 210px;
  min-width: 188px;
}
.Showcase1-top {
  display: flex;
  width: 100%;
  height: 74px;
}
.Showcase1-top-left {
  width: 50px;
  height: 74px;
}
.Showcase1-top-center {
  flex: 1;
  height: 74px;
  background-repeat: repeat;
  background-size: auto 100%;
}
.Showcase1-top-right {
  width: 64px;
  height: 74px;
}
.Showcase1-center {
  position: relative; 
  display: flex; 
  width: 100%; 
  // flex: 1;
  height: calc(100% - 186px);
} 
.ex-item {
  display: flex;
  justify-content: center;
  position: absolute;
  top: 20px;
  width: 188px;
  height: 48px;
  z-index: 30;
  background-repeat: repeat;
  background-size: 100% 100%;
}
.name-box {
  width: 172px;
  height: 28px;
  font-family: SourceHanSerifCN-Bold;
  font-size: 18px;
  color: #623333;
  line-height: 28px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
  margin-top: 4px;
}
.Showcase1-center-left {
  width: 50px;
  height: 100%;
}
.Showcase1-center-center {
  flex: 1;
  height: 100%;
  background-repeat: repeat;
  background-size: 100% 100%;
}
.Showcase1-bottom {
  display: flex;
  width: 100%;
  height: 112px;
}
.Showcase1-bottom-left {
  width: 60px;
  height: 112px;
}
.Showcase1-bottom-center {
  flex: 1;
  height: 112px;
  background-repeat: repeat;
  background-size: auto 100%;
}
.Showcase1-bottom-right {
  width: 20px;
  height: 112px;
}
.shadow-box {
  display: flex;
  position: absolute;
  bottom: -340px;
  left: 0;
  z-index: -1;
  width: 100%;
  height: 360px;
}
.shadow-left {
  width: 60px;
  height: 360px;
}
.shadow-center {
  flex: 1;
  height: 100%;
  background-repeat: repeat;
  background-size: 100% 100%;
}
.shadow-right {
  width: 10px;
  height: 360px;
}
</style>